﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;


namespace WaiGaoQiaoWeb.Models
{
    public class PostUnitVM
    {
        #region -------------  字段------------------------
        /// <summary>
        /// ID
        /// </summary>
        public int ID { get; set; }
        /// <summary>
        /// 工号
        /// </summary>
        [DisplayName("工号")]
        [Required(ErrorMessage = "工号不能为空")]
        public String PersonNo { get; set; }
        /// <summary>
        /// 人员姓名
        /// </summary>
        [DisplayName("人员姓名")]
        [Required(ErrorMessage = "人员姓名不能为空")]
        public String PersonName { get; set; }
        /// <summary>
        /// 物品名称
        /// </summary>
        [DisplayName("物品名称")]
        [Required(ErrorMessage = "物品名称不能为空")]
        [Range(1,100,ErrorMessage="请选择物品名称")]
        public int ArticleId { get; set; }
        /// <summary>
        /// 规格/型号
        /// </summary>
        [DisplayName("规格/型号")]
        [Required(ErrorMessage = "规格/型号不能为空")]
        [Range(1, 100, ErrorMessage = "请选择规格/型号")]
        [Remote("ValidateExists", "PersonPostUnit", AdditionalFields = "PersonNo,ArticleId,RuleId", HttpMethod = "POST", ErrorMessage = "已定义这种领取规格")]
        public int RuleId { get; set; }

        #endregion
    }
}